package com.demo2do.fms.admin.dao.business;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.demo2do.core.persistence.GenericDaoSupport;
import com.demo2do.fms.entity.remote.RemoteMessage;

/**
 * 写供方系统上游表辅助类
 *
 * @author Ark
 *
 */
@Repository("remoteMessageDaoSupport")
public class RemoteMessageDaoSupport {
    
    @Autowired
    private GenericDaoSupport genericDaoSupport;
    
    /**
     * 调度指令已派车
     * 
     * @param businessId
     * @param assistantId
     * @param operator
     * @param other3
     */
    public void generateDispatch(Long businessId, Long assistantId, String operator, String other3) {
        
        RemoteMessage remoteMessage = new RemoteMessage(1L, businessId, assistantId, operator, other3);
        genericDaoSupport.save(remoteMessage);
        
    }
    
    /**
     * 调度指令执行完成
     * 
     * @param businessId
     * @param assistantId
     * @param operator
     * @param other3
     */
    public void complateDispatch(Long businessId, Long assistantId, String operator, String other3) {
        
        RemoteMessage remoteMessage = new RemoteMessage(2L, businessId, assistantId, operator, other3);
        genericDaoSupport.save(remoteMessage);
        
    }
    
    /**
     * 委托方销单
     * 
     * @param businessId
     * @param operator
     */
    public void dispose(Long businessId, String operator) {
        
        RemoteMessage remoteMessage = new RemoteMessage(3L, businessId, operator);
        genericDaoSupport.save(remoteMessage);
        
    }
    
    // 4. SAP开票
    
    // 5. 质损信息反馈
    
    // 6. 驳运车动态
    
    /**
     * 调度指令取消派车
     * 
     * @param businessId
     * @param assistantId
     * @param operator
     * @param other3
     */
    public void cancelDispatch(Long businessId, Long assistantId, String operator, String other3) {
        
        RemoteMessage remoteMessage = new RemoteMessage(7L, businessId, assistantId, operator, other3);
        genericDaoSupport.save(remoteMessage);
        
    }
    
    /**
     * 回单确认
     * 
     * @param businessId
     * @param assistantId
     * @param operator
     * @param other3
     */
    public void accomplishConfirm(Long businessId, Long assistantId, String operator, String other3) {
        
        RemoteMessage remoteMessage = new RemoteMessage(8L, businessId, assistantId, operator, other3);
        genericDaoSupport.save(remoteMessage);
        
    }

}
